package day37.edu;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.function.Predicate;

// Created: 07/10/2025, ChangJiang Ru
public class Exer1 {
    public static void main(String[] args)
    {
        ArrayList<Integer> arrayList = new ArrayList<Integer>();

        for (int i = 0; i < 5; i++) {
            int random = (int)(Math.random() * (99 - 0 + 1));
            arrayList.add(random);
        }

        for(Integer value : arrayList)
        {
            System.out.println(value);
        }

        arrayList.removeIf(new Predicate<Integer>(){
            @Override
            public boolean test(Integer value)
            {
                return value % 2 == 0;
            }
        });

        /*
        for (Integer value : arrayList)
        {
            System.out.println(value);
        }
         */

        System.out.println("==============");

        Iterator<Integer> iterator = arrayList.iterator();
        while(iterator.hasNext())
        {
            Integer integer = iterator.next();
            int score = integer;
            System.out.println(score);
        }
    }
}
